<?php
/**
 * Autoloads my classes created specially for JForms
 *
 * @author chaporgin_a
 */
function jforms_autoloader($class_name){
  $pathElements = explode('_', $class_name);
//  $relativePath = str_replace('_', DIRECTORY_SEPARATOR, $class_name).'.php';
  $relativePath = join(DIRECTORY_SEPARATOR, $pathElements).'.php';
  if(file_exists(JPATH_COMPONENT_ADMINISTRATOR.DIRECTORY_SEPARATOR.$relativePath)){
    require_once JPATH_COMPONENT_ADMINISTRATOR.DIRECTORY_SEPARATOR.$relativePath;
    return TRUE;
  }  
}

spl_autoload_register('jforms_autoloader');